package com.dayaokeji.rhythmschoolstudent.client.mine;

import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;

import com.dayaokeji.rhythmschoolstudent.BuildConfig;
import com.dayaokeji.rhythmschoolstudent.R;
import com.dayaokeji.rhythmschoolstudent.client.common.base.common.BaseActivity;
import com.dayaokeji.rhythmschoolstudent.utils.ToastUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 关于我们
 */
public class AboutUsActivity extends BaseActivity {

    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.tv_app_version)
    TextView tvAppVersion;

    @SuppressLint("SetTextI18n")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);
        setSupportActionBar(toolbar);

        tvAppVersion.setText("律动学生版 v"+BuildConfig.VERSION_NAME);
    }

    @OnClick({R.id.ll_go_market,R.id.ll_company_intro})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_go_market:
                goMarket();
                break;
            case R.id.ll_company_intro:
                CompanyIntroActivity.Companion.navigation(this);
                break;
        }
    }

    private void goMarket() {
        try{
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.dayaokeji.rhythmschoolstudent")));
        }catch (ActivityNotFoundException e) {
            ToastUtils.info("啊哦，您的爱机上没有安装应用市场@_@");
        }
    }

}
